package drone.basis.map ;

import java.util.LinkedList ;
import java.util.List ;

import com.alibaba.fastjson.JSONArray ;
import com.alibaba.fastjson.JSONObject ;

import drone.basis.assist.LngLat ;

public class QingyunMap
{

	public static List < LngLat > POLYGON = new LinkedList < LngLat > ( ) ;
	static
	{
		POLYGON.add ( new LngLat ( "117.36763", "37.7794") ) ;
		POLYGON.add ( new LngLat ( "117.39321", "37.77926") ) ;
		POLYGON.add ( new LngLat ( "117.37638", "37.76407") ) ;
	}
	
	public static List < LngLat > POINTS = new LinkedList < LngLat > ( ) ;

	static
	{
		POINTS.add ( new LngLat ( "117.376277" , "37.657873" ) ) ;
		POINTS.add ( new LngLat ( "117.393786" , "37.663993" ) ) ;
		POINTS.add ( new LngLat ( "117.396781" , "37.66637" ) ) ;
		POINTS.add ( new LngLat ( "117.404383" , "37.673442" ) ) ;
		POINTS.add ( new LngLat ( "117.406433" , "37.681157" ) ) ;
		POINTS.add ( new LngLat ( "117.409422" , "37.684187" ) ) ;
		POINTS.add ( new LngLat ( "117.412738" , "37.686813" ) ) ;
		POINTS.add ( new LngLat ( "117.416788" , "37.682427" ) ) ;
		POINTS.add ( new LngLat ( "117.420741" , "37.682709" ) ) ;
		POINTS.add ( new LngLat ( "117.426816" , "37.680823" ) ) ;
		POINTS.add ( new LngLat ( "117.438117" , "37.678238" ) ) ;
		POINTS.add ( new LngLat ( "117.446778" , "37.675784" ) ) ;
		POINTS.add ( new LngLat ( "117.449616" , "37.677084" ) ) ;
		POINTS.add ( new LngLat ( "117.453179" , "37.681534" ) ) ;
		POINTS.add ( new LngLat ( "117.457629" , "37.679656" ) ) ;
		POINTS.add ( new LngLat ( "117.460595" , "37.672299" ) ) ;
		POINTS.add ( new LngLat ( "117.463048" , "37.668446" ) ) ;
		POINTS.add ( new LngLat ( "117.466472" , "37.667442" ) ) ;
		POINTS.add ( new LngLat ( "117.469361" , "37.669209" ) ) ;
		POINTS.add ( new LngLat ( "117.469554" , "37.665695" ) ) ;
		POINTS.add ( new LngLat ( "117.472535" , "37.6636" ) ) ;
		POINTS.add ( new LngLat ( "117.474563" , "37.659748" ) ) ;
		POINTS.add ( new LngLat ( "117.483292" , "37.65784" ) ) ;
		POINTS.add ( new LngLat ( "117.486765" , "37.662058" ) ) ;
		POINTS.add ( new LngLat ( "117.485796" , "37.667415" ) ) ;
		POINTS.add ( new LngLat ( "117.491373" , "37.679087" ) ) ;
		POINTS.add ( new LngLat ( "117.502451" , "37.686393" ) ) ;
		POINTS.add ( new LngLat ( "117.50613" , "37.684719" ) ) ;
		POINTS.add ( new LngLat ( "117.509596" , "37.686045" ) ) ;
		POINTS.add ( new LngLat ( "117.511424" , "37.688421" ) ) ;
		POINTS.add ( new LngLat ( "117.512647" , "37.691577" ) ) ;
		POINTS.add ( new LngLat ( "117.517599" , "37.694052" ) ) ;
		POINTS.add ( new LngLat ( "117.533244" , "37.694192" ) ) ;
		POINTS.add ( new LngLat ( "117.537003" , "37.695279" ) ) ;
		POINTS.add ( new LngLat ( "117.540844" , "37.699058" ) ) ;
		POINTS.add ( new LngLat ( "117.547739" , "37.705239" ) ) ;
		POINTS.add ( new LngLat ( "117.54745" , "37.710214" ) ) ;
		POINTS.add ( new LngLat ( "117.543648" , "37.712008" ) ) ;
		POINTS.add ( new LngLat ( "117.546509" , "37.715465" ) ) ;
		POINTS.add ( new LngLat ( "117.546092" , "37.719452" ) ) ;
		POINTS.add ( new LngLat ( "117.554575" , "37.721671" ) ) ;
		POINTS.add ( new LngLat ( "117.559436" , "37.717765" ) ) ;
		POINTS.add ( new LngLat ( "117.562659" , "37.719651" ) ) ;
		POINTS.add ( new LngLat ( "117.560527" , "37.722909" ) ) ;
		POINTS.add ( new LngLat ( "117.555411" , "37.726359" ) ) ;
		POINTS.add ( new LngLat ( "117.550338" , "37.731455" ) ) ;
		POINTS.add ( new LngLat ( "117.548196" , "37.735185" ) ) ;
		POINTS.add ( new LngLat ( "117.551342" , "37.738356" ) ) ;
		POINTS.add ( new LngLat ( "117.551435" , "37.749285" ) ) ;
		POINTS.add ( new LngLat ( "117.549472" , "37.751414" ) ) ;
		POINTS.add ( new LngLat ( "117.546705" , "37.753048" ) ) ;
		POINTS.add ( new LngLat ( "117.538897" , "37.754636" ) ) ;
		POINTS.add ( new LngLat ( "117.53348" , "37.759744" ) ) ;
		POINTS.add ( new LngLat ( "117.52811" , "37.759556" ) ) ;
		POINTS.add ( new LngLat ( "117.527599" , "37.763844" ) ) ;
		POINTS.add ( new LngLat ( "117.534712" , "37.76877" ) ) ;
		POINTS.add ( new LngLat ( "117.540419" , "37.769074" ) ) ;
		POINTS.add ( new LngLat ( "117.544582" , "37.772087" ) ) ;
		POINTS.add ( new LngLat ( "117.551247" , "37.773193" ) ) ;
		POINTS.add ( new LngLat ( "117.552526" , "37.776673" ) ) ;
		POINTS.add ( new LngLat ( "117.551195" , "37.779369" ) ) ;
		POINTS.add ( new LngLat ( "117.555656" , "37.78439" ) ) ;
		POINTS.add ( new LngLat ( "117.557492" , "37.793496" ) ) ;
		POINTS.add ( new LngLat ( "117.565562" , "37.806245" ) ) ;
		POINTS.add ( new LngLat ( "117.568778" , "37.807207" ) ) ;
		POINTS.add ( new LngLat ( "117.570398" , "37.805424" ) ) ;
		POINTS.add ( new LngLat ( "117.571857" , "37.805329" ) ) ;
		POINTS.add ( new LngLat ( "117.573999" , "37.811663" ) ) ;
		POINTS.add ( new LngLat ( "117.573084" , "37.817078" ) ) ;
		POINTS.add ( new LngLat ( "117.575188" , "37.820684" ) ) ;
		POINTS.add ( new LngLat ( "117.578211" , "37.823385" ) ) ;
		POINTS.add ( new LngLat ( "117.584242" , "37.823755" ) ) ;
		POINTS.add ( new LngLat ( "117.589586" , "37.825791" ) ) ;
		POINTS.add ( new LngLat ( "117.597782" , "37.834176" ) ) ;
		POINTS.add ( new LngLat ( "117.609007" , "37.843791" ) ) ;
		POINTS.add ( new LngLat ( "117.612566" , "37.85079" ) ) ;
		POINTS.add ( new LngLat ( "117.608854" , "37.852934" ) ) ;
		POINTS.add ( new LngLat ( "117.607524" , "37.85446" ) ) ;
		POINTS.add ( new LngLat ( "117.606476" , "37.857163" ) ) ;
		POINTS.add ( new LngLat ( "117.597881" , "37.859091" ) ) ;
		POINTS.add ( new LngLat ( "117.593831" , "37.860687" ) ) ;
		POINTS.add ( new LngLat ( "117.590461" , "37.864917" ) ) ;
		POINTS.add ( new LngLat ( "117.587764" , "37.872487" ) ) ;
		POINTS.add ( new LngLat ( "117.586329" , "37.87974" ) ) ;
		POINTS.add ( new LngLat ( "117.578161" , "37.884061" ) ) ;
		POINTS.add ( new LngLat ( "117.572962" , "37.883367" ) ) ;
		POINTS.add ( new LngLat ( "117.571429" , "37.887618" ) ) ;
		POINTS.add ( new LngLat ( "117.567707" , "37.888648" ) ) ;
		POINTS.add ( new LngLat ( "117.555486" , "37.886795" ) ) ;
		POINTS.add ( new LngLat ( "117.553494" , "37.889929" ) ) ;
		POINTS.add ( new LngLat ( "117.547802" , "37.891404" ) ) ;
		POINTS.add ( new LngLat ( "117.545317" , "37.894464" ) ) ;
		POINTS.add ( new LngLat ( "117.548666" , "37.898778" ) ) ;
		POINTS.add ( new LngLat ( "117.549553" , "37.908656" ) ) ;
		POINTS.add ( new LngLat ( "117.550317" , "37.912988" ) ) ;
		POINTS.add ( new LngLat ( "117.547557" , "37.913246" ) ) ;
		POINTS.add ( new LngLat ( "117.54485" , "37.91457" ) ) ;
		POINTS.add ( new LngLat ( "117.54102" , "37.925826" ) ) ;
		POINTS.add ( new LngLat ( "117.536869" , "37.926049" ) ) ;
		POINTS.add ( new LngLat ( "117.535535" , "37.928809" ) ) ;
		POINTS.add ( new LngLat ( "117.540565" , "37.934463" ) ) ;
		POINTS.add ( new LngLat ( "117.543805" , "37.939303" ) ) ;
		POINTS.add ( new LngLat ( "117.551116" , "37.945661" ) ) ;
		POINTS.add ( new LngLat ( "117.556479" , "37.946657" ) ) ;
		POINTS.add ( new LngLat ( "117.563602" , "37.949847" ) ) ;
		POINTS.add ( new LngLat ( "117.570312" , "37.95351" ) ) ;
		POINTS.add ( new LngLat ( "117.577101" , "37.957662" ) ) ;
		POINTS.add ( new LngLat ( "117.578848" , "37.96419" ) ) ;
		POINTS.add ( new LngLat ( "117.572608" , "37.966245" ) ) ;
		POINTS.add ( new LngLat ( "117.570572" , "37.967668" ) ) ;
		POINTS.add ( new LngLat ( "117.574738" , "37.976159" ) ) ;
		POINTS.add ( new LngLat ( "117.574814" , "37.978302" ) ) ;
		POINTS.add ( new LngLat ( "117.570475" , "37.989209" ) ) ;
		POINTS.add ( new LngLat ( "117.571471" , "37.990377" ) ) ;
		POINTS.add ( new LngLat ( "117.574489" , "37.986789" ) ) ;
		POINTS.add ( new LngLat ( "117.575858" , "37.987562" ) ) ;
		POINTS.add ( new LngLat ( "117.572851" , "37.99507" ) ) ;
		POINTS.add ( new LngLat ( "117.567075" , "38.001266" ) ) ;
		POINTS.add ( new LngLat ( "117.56768" , "38.007159" ) ) ;
		POINTS.add ( new LngLat ( "117.566154" , "38.009655" ) ) ;
		POINTS.add ( new LngLat ( "117.558341" , "38.008741" ) ) ;
		POINTS.add ( new LngLat ( "117.555186" , "38.009178" ) ) ;
		POINTS.add ( new LngLat ( "117.548098" , "38.015686" ) ) ;
		POINTS.add ( new LngLat ( "117.539739" , "38.007957" ) ) ;
		POINTS.add ( new LngLat ( "117.530739" , "37.995065" ) ) ;
		POINTS.add ( new LngLat ( "117.52459" , "37.964783" ) ) ;
		POINTS.add ( new LngLat ( "117.51725" , "37.946457" ) ) ;
		POINTS.add ( new LngLat ( "117.509559" , "37.94113" ) ) ;
		POINTS.add ( new LngLat ( "117.497322" , "37.932327" ) ) ;
		POINTS.add ( new LngLat ( "117.484111" , "37.915547" ) ) ;
		POINTS.add ( new LngLat ( "117.465184" , "37.88665" ) ) ;
		POINTS.add ( new LngLat ( "117.446963" , "37.861594" ) ) ;
		POINTS.add ( new LngLat ( "117.444322" , "37.858781" ) ) ;
		POINTS.add ( new LngLat ( "117.433766" , "37.854431" ) ) ;
		POINTS.add ( new LngLat ( "117.410379" , "37.849351" ) ) ;
		POINTS.add ( new LngLat ( "117.39026" , "37.859396" ) ) ;
		POINTS.add ( new LngLat ( "117.37622" , "37.859911" ) ) ;
		POINTS.add ( new LngLat ( "117.3542" , "37.867184" ) ) ;
		POINTS.add ( new LngLat ( "117.342988" , "37.869004" ) ) ;
		POINTS.add ( new LngLat ( "117.331697" , "37.867516" ) ) ;
		POINTS.add ( new LngLat ( "117.3198" , "37.864411" ) ) ;
		POINTS.add ( new LngLat ( "117.318244" , "37.861554" ) ) ;
		POINTS.add ( new LngLat ( "117.32426" , "37.858984" ) ) ;
		POINTS.add ( new LngLat ( "117.324314" , "37.856276" ) ) ;
		POINTS.add ( new LngLat ( "117.32603" , "37.855325" ) ) ;
		POINTS.add ( new LngLat ( "117.330548" , "37.852468" ) ) ;
		POINTS.add ( new LngLat ( "117.335097" , "37.857351" ) ) ;
		POINTS.add ( new LngLat ( "117.337657" , "37.857365" ) ) ;
		POINTS.add ( new LngLat ( "117.340646" , "37.856557" ) ) ;
		POINTS.add ( new LngLat ( "117.341254" , "37.855698" ) ) ;
		POINTS.add ( new LngLat ( "117.344738" , "37.851094" ) ) ;
		POINTS.add ( new LngLat ( "117.350642" , "37.850945" ) ) ;
		POINTS.add ( new LngLat ( "117.353903" , "37.847005" ) ) ;
		POINTS.add ( new LngLat ( "117.353751" , "37.842585" ) ) ;
		POINTS.add ( new LngLat ( "117.355454" , "37.838548" ) ) ;
		POINTS.add ( new LngLat ( "117.35879" , "37.836199" ) ) ;
		POINTS.add ( new LngLat ( "117.359076" , "37.833701" ) ) ;
		POINTS.add ( new LngLat ( "117.355888" , "37.832711" ) ) ;
		POINTS.add ( new LngLat ( "117.346289" , "37.829757" ) ) ;
		POINTS.add ( new LngLat ( "117.342887" , "37.830262" ) ) ;
		POINTS.add ( new LngLat ( "117.341315" , "37.829857" ) ) ;
		POINTS.add ( new LngLat ( "117.339949" , "37.831033" ) ) ;
		POINTS.add ( new LngLat ( "117.336348" , "37.828227" ) ) ;
		POINTS.add ( new LngLat ( "117.333506" , "37.828209" ) ) ;
		POINTS.add ( new LngLat ( "117.332607" , "37.826827" ) ) ;
		POINTS.add ( new LngLat ( "117.329956" , "37.819763" ) ) ;
		POINTS.add ( new LngLat ( "117.323954" , "37.817104" ) ) ;
		POINTS.add ( new LngLat ( "117.320143" , "37.816169" ) ) ;
		POINTS.add ( new LngLat ( "117.318593" , "37.808867" ) ) ;
		POINTS.add ( new LngLat ( "117.315019" , "37.807041" ) ) ;
		POINTS.add ( new LngLat ( "117.310116" , "37.80304" ) ) ;
		POINTS.add ( new LngLat ( "117.310823" , "37.801765" ) ) ;
		POINTS.add ( new LngLat ( "117.315913" , "37.798599" ) ) ;
		POINTS.add ( new LngLat ( "117.316566" , "37.796945" ) ) ;
		POINTS.add ( new LngLat ( "117.317823" , "37.793784" ) ) ;
		POINTS.add ( new LngLat ( "117.321186" , "37.791103" ) ) ;
		POINTS.add ( new LngLat ( "117.32161" , "37.789897" ) ) ;
		POINTS.add ( new LngLat ( "117.318061" , "37.788997" ) ) ;
		POINTS.add ( new LngLat ( "117.316775" , "37.787146" ) ) ;
		POINTS.add ( new LngLat ( "117.317831" , "37.784845" ) ) ;
		POINTS.add ( new LngLat ( "117.319689" , "37.783867" ) ) ;
		POINTS.add ( new LngLat ( "117.320073" , "37.781293" ) ) ;
		POINTS.add ( new LngLat ( "117.318068" , "37.778092" ) ) ;
		POINTS.add ( new LngLat ( "117.318193" , "37.776449" ) ) ;
		POINTS.add ( new LngLat ( "117.321533" , "37.775546" ) ) ;
		POINTS.add ( new LngLat ( "117.322446" , "37.772819" ) ) ;
		POINTS.add ( new LngLat ( "117.320647" , "37.770355" ) ) ;
		POINTS.add ( new LngLat ( "117.320866" , "37.767543" ) ) ;
		POINTS.add ( new LngLat ( "117.319598" , "37.765427" ) ) ;
		POINTS.add ( new LngLat ( "117.322884" , "37.7597" ) ) ;
		POINTS.add ( new LngLat ( "117.322591" , "37.753174" ) ) ;
		POINTS.add ( new LngLat ( "117.321816" , "37.749669" ) ) ;
		POINTS.add ( new LngLat ( "117.32331" , "37.746753" ) ) ;
		POINTS.add ( new LngLat ( "117.31917" , "37.742254" ) ) ;
		POINTS.add ( new LngLat ( "117.31933" , "37.740888" ) ) ;
		POINTS.add ( new LngLat ( "117.322567" , "37.738868" ) ) ;
		POINTS.add ( new LngLat ( "117.324831" , "37.738211" ) ) ;
		POINTS.add ( new LngLat ( "117.325562" , "37.734985" ) ) ;
		POINTS.add ( new LngLat ( "117.32564" , "37.730148" ) ) ;
		POINTS.add ( new LngLat ( "117.331034" , "37.727225" ) ) ;
		POINTS.add ( new LngLat ( "117.331872" , "37.722634" ) ) ;
		POINTS.add ( new LngLat ( "117.330374" , "37.72014" ) ) ;
		POINTS.add ( new LngLat ( "117.328585" , "37.71288" ) ) ;
		POINTS.add ( new LngLat ( "117.32763" , "37.707474" ) ) ;
		POINTS.add ( new LngLat ( "117.328959" , "37.708571" ) ) ;
		POINTS.add ( new LngLat ( "117.329965" , "37.711217" ) ) ;
		POINTS.add ( new LngLat ( "117.334953" , "37.710766" ) ) ;
		POINTS.add ( new LngLat ( "117.33653" , "37.70895" ) ) ;
		POINTS.add ( new LngLat ( "117.333391" , "37.70606" ) ) ;
		POINTS.add ( new LngLat ( "117.334973" , "37.705334" ) ) ;
		POINTS.add ( new LngLat ( "117.338365" , "37.709215" ) ) ;
		POINTS.add ( new LngLat ( "117.339944" , "37.710937" ) ) ;
		POINTS.add ( new LngLat ( "117.34968" , "37.713715" ) ) ;
		POINTS.add ( new LngLat ( "117.35739" , "37.714553" ) ) ;
		POINTS.add ( new LngLat ( "117.366679" , "37.708336" ) ) ;
		POINTS.add ( new LngLat ( "117.372764" , "37.702586" ) ) ;
		POINTS.add ( new LngLat ( "117.37046" , "37.690644" ) ) ;
		POINTS.add ( new LngLat ( "117.37143" , "37.684787" ) ) ;
		POINTS.add ( new LngLat ( "117.363028" , "37.67486" ) ) ;
		POINTS.add ( new LngLat ( "117.366155" , "37.66947" ) ) ;
		POINTS.add ( new LngLat ( "117.366857" , "37.660701" ) ) ;

	}
	
	public static String plainPolygon ( )
	{
		StringBuffer sb = new StringBuffer ( ) ;
		for ( LngLat ll : POLYGON )
		{
			sb.append ( ll.getLng ( ) + ","+ ll.getLat ( ) + ";") ;
		}
		return sb.toString ( ) ;
	}

	public static String jsonPolygon ( )
	{
		JSONArray array = new JSONArray ( ) ;
		for ( LngLat ll : POLYGON )
		{
			JSONObject object = new JSONObject ( ) ;
			object.put ( "lng", ll.getLng ( ) ) ;
			object.put ( "lat", ll.getLat ( ) ) ;
			array.add ( object ) ;
		}
		return array.toJSONString ( ) ;
	}

	public static String plainPoints ( )
	{
		StringBuffer sb = new StringBuffer ( ) ;
		for ( LngLat ll : POINTS )
		{
			sb.append ( ll.getLng ( ) + "," + ll.getLat ( ) + ";" ) ;
		}
		return sb.toString ( ) ;
	}

	public static String jsonPoints ( )
	{
		JSONArray array = new JSONArray ( ) ;
		for ( LngLat ll : POINTS )
		{
			JSONObject object = new JSONObject ( ) ;
			object.put ( "lng" , ll.getLng ( ) ) ;
			object.put ( "lat" , ll.getLat ( ) ) ;
			array.add ( object ) ;
		}
		return array.toJSONString ( ) ;
	}

}
